﻿using ML.Entity;
using System.Collections.Generic;

namespace ML.IBusiness
{
    /// <summary>
    /// 用户收货地址业务接口
    /// </summary>
    public interface IReceivingAddressBusiness
    {
        /// <summary>
        /// 根据用户Id查询用户收货地址列表
        /// </summary>
        /// <param name="id">用户的id</param>
        /// <returns></returns>
        BaseResult<IEnumerable<ReceivingAddressEntity>> GetListByUserId(string id);

        /// <summary>
        /// 根据用户Id查询用户的收货地址
        /// </summary>
        /// <param name="id">用户Id</param>
        /// <returns></returns>
        BaseResult<IEnumerable<ReceivingAddressEntity>> GetAddRessByUserId(string id);

        /// <summary>
        /// 前端已经在使用此接口—根据用户Id读取用户默认收货地址
        /// </summary>
        /// <param name="id">用户的id</param>
        /// <returns></returns>
        BaseResult<ReceivingAddressEntity> GetDefaulByUserId(string id);

        /// <summary>
        /// 前端已经在使用此接口—根据地址Id查询地址信息
        /// </summary>
        /// <param name="id">地址Id</param>
        /// <returns></returns>
        BaseResult<ReceivingAddressEntity> getById(string id);

        /// <summary>
        /// 前端已经在使用此接口—添加用户收货地址(设置为默认)
        /// </summary>
        /// <param name="receivingAddressEntity">用户收货地址实体</param>
        /// <returns></returns>
        BaseResult<bool> Add(ReceivingAddressEntity receivingAddressEntity);

        /// <summary>
        /// 前端已经在使用此接口—修改用户收货地址
        /// </summary>
        /// <param name="receivingAddressEntity">用户收货地址实体</param>
        /// <returns></returns>
        BaseResult<bool> Update(ReceivingAddressEntity receivingAddressEntity);

        /// <summary>
        /// 删除用户收货地址
        /// </summary>
        /// <param name="id">用户收货地址Id</param>
        /// <returns></returns>
        BaseResult<bool> Delete(string id);

        /// <summary>
        /// 设置默认用户收货地址
        /// </summary>
        /// <param name="id">用户收货地址Id</param>
        /// <param name="userid">用户Id</param>
        /// <returns></returns>
        BaseResult<bool> Default(string id, string userid);
    }
}